AMD IOMMU: If interrupt remapping is disabled, then do not update
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 18 Sep 2009 07:28:52 +0000 (08:28 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 18 Sep 2009 07:28:52 +0000 (08:28 +0100)
interrupt remapping table with IOAPIC write.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
xen/drivers/passthrough/amd/iommu_intr.c

index 00afa1cec63d75ab0830d856ab93612734f5be4e..c5b35ece4c035fe9c3c7cbdd793193fd7d3424de 100644 (file)
@@ -192,6 +192,9 @@ void amd_iommu_ioapic_update_ire(
     *IO_APIC_BASE(apic) = reg;
     *(IO_APIC_BASE(apic)+4) = value;
 
+    if ( !iommu_intremap )
+        return;
+
     /* get device id of ioapic devices */
     bdf = ioapic_bdf[IO_APIC_ID(apic)];
     iommu = find_iommu_for_device(bdf);
@@ -281,6 +284,9 @@ void amd_iommu_msi_msg_update_ire(
     struct pci_dev *pdev = msi_desc->dev;
     struct amd_iommu *iommu = NULL;
 
+    if ( !iommu_intremap )
+        return;
+
     iommu = find_iommu_for_device((pdev->bus << 8) | pdev->devfn);
 
     if ( !iommu )